<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopSpaceDesign extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_space_design', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('mainProcessId')->default(0)->comment('开店主流程id');
            $table->unsignedTinyInteger('step')->default(0)->comment('步骤 0 未开始 1 筹备确认 2 指派空间设计师 3 确认');
            $table->string('orderNo')->default('')->comment('订单号');
            $table->unsignedBigInteger('designUid')->default(0)->comment('空间设计师id');
            $table->string('designName')->default('')->comment('空间设计师姓名');
            $table->unsignedBigInteger('preparationUid')->default(0)->comment('筹备确认人id');
            $table->string('preparationName')->default('')->comment('筹备确认人姓名');
            $table->tinyInteger('isDeleted')->default(0)->comment('是否删除 0 否 1 是');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->index('mainProcessId');
            $table->comment = '空间设计表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_space_design');
    }
}
